//
//  TYRandomString.m
//  UnionMedApp
//
//  Created by 谢航宇 on 2023/6/26.
//  Copyright © 2023 唐家钦. All rights reserved.
//

#import "TYRandomString.h"
#define TYRandomStringArray @[@"a",@"b",@"c",@"d",@"e",@"f",@"g",@"h",@"i",@"j",@"k",@"l",@"m",@"n",@"o",@"p",@"q",@"r",@"s",@"t",@"u",@"v",@"w",@"x",@"y",@"z",@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z",@"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9"]
@implementation TYRandomString
+ (NSString *)getRandomStringWithLength:(NSInteger)length {
     NSString * randomString = @"";
     for (int i = 0; i < length; i++) {
          int randowNumber = arc4random()%TYRandomStringArray.count;
          randomString = [NSString stringWithFormat:@"%@%@",randomString,TYRandomStringArray[randowNumber]];
     }
     return randomString;
}
@end
